-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
chore(aci milestone 3): migrate remaining anomaly detection alerts #93574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(aci milestone 3): migrate remaining anomaly detection alerts #93574
Conversation
alert_rules = AlertRule.objects_with_snapshots.filter( | ||
status__in=[ | ||
AlertRuleStatus.PENDING.value, | ||
AlertRuleStatus.NOT_ENOUGH_DATA.value, | ||
], | ||
detection_type="dynamic", | ||
).filter(~Exists(AlertRuleDetector.objects.filter(alert_rule_id=OuterRef("id")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Main change is here—fetching the anomaly detection alerts that were not migrated.
AlertRuleTriggerActionType.SLACK.value: "Slack", | ||
AlertRuleTriggerActionType.MSTEAMS.value: "Microsoft Teams", | ||
AlertRuleTriggerActionType.OPSGENIE.value: "Opsgenie", | ||
AlertRuleTriggerActionType.DISCORD.value: "Discord", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this.
This PR has a migration; here is the generated SQL for for --
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL |
else: | ||
return "Email [removed]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this.
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #93574 +/- ##
===========================================
+ Coverage 46.30% 88.02% +41.71%
===========================================
Files 10306 10328 +22
Lines 594236 595483 +1247
Branches 23141 23141
===========================================
+ Hits 275175 524173 +248998
+ Misses 318568 70817 -247751
Partials 493 493 |
Migrate the alerts that didn't get correctly migrated the first run (due to errors with discord actions or the migration stalling).